home *** CD-ROM | disk | FTP | other *** search
- comment ~
-
- rename a file
-
- On entry:
- DX ASCIIZ string of file to be renamed
- DI ASCIIZ string of new name
-
- Error returns if CY set:
- 3 Path not found
- 5 Access denied
- 17 Not same device
-
- ~
- ;----------------------------------------------------------
- ; constants and messages
-
- rf_msg db cr,lf,'renfile: ',eos
-
- ;----------------------------------------------------------
- ; main code
-
- renfile proc near
-
- mov ah,56h
- int 21h
- jc rf_err
- ret
-
- rf_err:
- push ax ;save error code
- mov dx,offset rf_msg
- mov ah,9h
- int 21h
- pop ax
- push ax ;save again, to be sure
- call errmsg
- pop ax ;restore, to Q in caller
- stc
- ret
-
- renfile endp